<!DOCTYPE html>
<html>
	<head>
		<title>
			screen2
		</title>
	</head>

<body>
<?php

	//contains constraints
	require_once '../database/sql.php';
	session_start(); // gain access to global data

	//load data from table into an associative array
	foreach(sql_load() as $index => $values) {

		//search the master array for the drinks
		if($index == 'drinks') {
			$drinks = $values; //collect drinke elements
			$rows = count($values); //count number of elements
		} //conclude if
	} //conclude loop

	//return to the first screen option
	echo "<form  action=\"../home_page/home.php\">\n";
	echo "<input type=\"submit\" name=\"return\" value=\"return\"/>\n";
	echo "</form>\n"; //conclude return

	//commence table. commence form to return to user to the first screen
	echo "<form method=\"post\" action=\"../home_page/home.php\">\n";
	echo "<table border=\"1\">\n";  /*remove borders here*/
	echo "<tr>\n";

	//write drink content. takes up the left column of the screen
	echo "<td rowspan=\"$rows\">Yo Dawg. I heard you like Vultures</td>\n";
	
	//evaluate drink selections. 
	foreach ($drinks as $arr) { //builds the buttons along the right column
		echo "<td><input type=\"submit\" name=\"drink\" value=" . 
				"\"{$arr['name']}\" /></td>\n";
		echo "</tr>\n<tr>\n";
	} //conclude foreach

	echo "</tr>\n"; //conclude column
	echo "</table>\n"; //conclude table
	echo "</form>\n"; //conclude form

?>
</body>

</html>
